home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
utility
/
tsbat50.zip
/
REPLY.BAT
< prev
next >
Wrap
DOS Batch File
|
1995-09-04
|
1KB
|
42 lines
@echo off
echo.
echo ┌────────────────────────────────────────────────────────────────────┐
echo │ Demonstrate that it is possible to give input to a pure batch file │
echo │ By Prof. Timo Salmi, ts@uwasa.fi, Mon 4-September-1995 │
echo └────────────────────────────────────────────────────────────────────┘
echo.
rem For an even more inventive method see item #40 in batricks.txt
echo Give your reply as set r=YourReply terminated by ^Z (and Enter)
rem Read from the keyboard into a temporary auxiliary file
copy con replytmp.bat > nul
rem Set the r environment variable
if exist replytmp.bat call replytmp.bat
rem Get rid of the temporary file
del replytmp.bat > nul
rem Branch in accordance to the reply
for %%i in (y Y yes YES) do if %%i==%r% goto _yes
for %%i in (n N no NO) do if %%i==%r% goto _no
goto _indef
:_yes
echo Your reply was a "Yes"
goto _out
:_no
echo Your reply was a "No"
goto _out
:_indef
echo Your reply was indefinite
rem That's all folks
:_out
set r=
echo on